<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="con" style="border: 5px solid red;width: 400px;height: 300px;padding: 30px;">
        <img src="./images/1.png" width="100%">
    </div>
</body>
<script>
    var con =document.getElementById("con");
    
    con.onmouseover = function(){
        this.style.border = "5px solid blue";
    }

    //鼠标摁键摁下时，触发 onmousedown 事件
    con.onmousedown = function(){
        this.style.backgroundColor="pink";
    }

    //鼠标摁键松开时，触发 onmouseup 事件
    con.onmouseup = function(){
        this.style.backgroundColor="white";
    }
    con.onclick = function(){
        console.log(this.style.height,this.style.width);
    }
</script>
</html>